VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "Gender"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit

' the following pertain to being supported by
'   VBOFCollection, VBOFObjectManager and
'   VBOFEventManager
Public ObjectID As Long
Public ObjectChanged As Long
Public ObjectAdded As Long
Public ObjectDeleted As Long
Public ObjectParentCount As Long
Public ObjectManager As VBOFObjectManager

Public GenderCode As String
Public Description As String

Public Function ObjectSortCompare(Optional SortField As Variant, Optional SortOrder As Variant, Optional CompareObject As Variant) As Long
' Support the Collection.Sort method
' Note: use the ObjectManager.ObjectSortCompare
'   method for assistance

    Select Case SortField
        Case "GenderCode"
            ObjectSortCompare = _
                ObjectManager.ObjectSortCompare( _
                    Value1:=GenderCode, _
                    Value2:=CompareObject.GenderCode, _
                    SortOrder:=SortOrder)
        
        Case "CapitalCity"
            ObjectSortCompare = _
                ObjectManager.ObjectSortCompare( _
                    Value1:=Description, _
                    Value2:=CompareObject.Description, _
                    SortOrder:=SortOrder)
    End Select

End Function



Public Function ObjectInitializeFromRecordSet(Optional RecordSet As Variant) As Address
' Populate my variables from the RecordSet
'   (in support of VBOFCollection)

    On Local Error Resume Next
    
    GenderCode = RecordSet("GenderCode")
    Description = RecordSet("Description")
    
    ObjectID = RecordSet("ObjectID")

    Set ObjectInitializeFromRecordSet = Me
End Function

Public Function ObjectListBoxValue() As String
' Return a String will represent this object
'   in a ListBox
'   (in support of VBOFCollection)

    ObjectListBoxValue = _
        GenderCode & " (" & Description & ")"

End Function

Public Function ObjectNewInstanceOfMyClass() As Gender
' Return a new instance of this class
'   (in support of VBOFCollection)

    Set ObjectNewInstanceOfMyClass = New Gender
End Function

Public Function ObjectDataSource() As String
' Return the Data Source with which this Class is associated
'   (in support of VBOFCollection)
    
    ObjectDataSource = "GenderCodes"
End Function


